package com.jyh.homework.homework1;

/**
 * @Author JYH
 * @Date 2024/8/7 17:06
 * @Description
 */
public class MyThread extends Thread{
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }
    @Override
    public void run(){
        for (int i = 1; i <= 5; i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"第"+i+"次执行");
        }
    }
}
